package cn.yyh.serviceOrg.service.impl;

import cn.yyh.commons.service.impl.MyBaseServiceImpl;
import cn.yyh.serviceOrg.entity.User;
import cn.yyh.serviceOrg.entity.UserAddress;
import cn.yyh.serviceOrg.mapper.UserAddressMapper;
import cn.yyh.serviceOrg.mapper.UserMapper;
import cn.yyh.serviceOrg.service.IUserAddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserAddressServiceImpl extends MyBaseServiceImpl<UserAddressMapper, UserAddress> implements IUserAddressService {

    @Autowired
    private UserMapper userMapper;

    @Override
    public List<UserAddress> listAll(Long id) {
        User user = userMapper.getByLoginInfoId(id);
        return baseMapper.getByUserId(user.getId());
    }
}
